import request from '@/utils/request';
import { OrderStatus, OrderType, Page } from '@/type/orderType';
import { Response } from '@/type/ResponseType';

enum Enum {
  fetchOrderListAPI = '/order/orderInfo/auth',
  fetchOrderStatusListAPI = '/order/orderInfo/auth/getStatusList'
}

/**
 * @description 获取挂号订单的接口
 * */

export const fetchOrderListAPI = (page: Page) => request.get<OrderType, Response<OrderType>>(`${Enum.fetchOrderListAPI}/${page.page}/${page.limit}`, {
  params: {
    patientId: page.patientId,
    orderStatus: page.orderStatus,
  },
});

/**
 * @description 获取挂号订单状态的接口
 * */
export const fetchOrderStatusListAPI = () => request.get<OrderStatus[], Response<OrderStatus[]>>(Enum.fetchOrderStatusListAPI);
